import request from '@/utils/request'

// 查询时间管理列表
export function listTimeng(query) {
  return request({
    url: '/appointment/timeng/list',
    method: 'get',
    params: query
  })
}

// 查询时间管理详细
export function getTimeng(timeId) {
  return request({
    url: '/appointment/timeng/' + timeId,
    method: 'get'
  })
}

// 新增时间管理
export function addTimeng(data) {
  return request({
    url: '/appointment/timeng',
    method: 'post',
    data: data
  })
}

// 修改时间管理
export function updateTimeng(data) {
  return request({
    url: '/appointment/timeng',
    method: 'put',
    data: data
  })
}

// 删除时间管理
export function delTimeng(timeId) {
  return request({
    url: '/appointment/timeng/' + timeId,
    method: 'delete'
  })
}


// 根据医生的Id查询对应的排班表
export function findDoctorId(doctorId) {
  return request({
    url: '/appointment/timeng/findDoctorId/' + doctorId,
    method: 'get'
  })
}

//请假
export function leave(data) {
  return request({
    url: '/appointment/timeng/leave',
    method: 'post',
    data: data
  })
}
